package com.month.train.common.util;

import cn.hutool.core.util.IdUtil;

// 封装hutool雪花算法
public class SnowUtil {
    private static long dataCenterID = 1;
    private static long workerId = 1;

    public static long getSnowflakeNextId() {
        return IdUtil.getSnowflake(workerId,dataCenterID).nextId();
    }
    public static String getSnowflakeNextIdStr() {
        return IdUtil.getSnowflake(workerId,dataCenterID).nextIdStr();
    }
}
